#region

using System;
using VeeTileEngine2012;

#endregion

namespace TimeDRODPOF.TDComponents
{
    public class TDCSpecialSquare : Component
    {
        #region Delegates

        public delegate bool SpecialSquareEvent(Entity mEntity, int mNextX, int mNextY, bool mNextSuccess, out bool mAbort);

        #endregion

        public event SpecialSquareEvent OnMoveFromAllowed;

        public bool InvokeOnMoveFromAllowed(Entity mEntity, int mNextX, int mNextY, bool mNextSuccess, out bool mAbort)
        {
            mAbort = false;
            var handler = OnMoveFromAllowed;
            return handler == null || handler(mEntity, mNextX, mNextY, mNextSuccess, out mAbort);
        }

        public event SpecialSquareEvent OnMoveToAllowed;

        public bool InvokeOnMoveToAllowed(Entity mEntity, int mNextX, int mNextY, bool mNextSuccess, out bool mAbort)
        {
            mAbort = false;
            var handler = OnMoveToAllowed;
            return handler == null || handler(mEntity, mNextX, mNextY, mNextSuccess, out mAbort);
        }
    }
}